import QtQuick 2.0
import QtQuick.Layouts 1.14
import QtGraphicalEffects 1.14
import QtQuick.Controls 1.4
import QtQuick 2.14
import "../component"

Item {
    id:root
    property string  pageColor : '#CECDCD'          // 页面背景颜色
    property string  recSelectColor: '#1989FA'  // A3 A4 A5 A6 被点击选择切换的颜色
    property int     selectInx: 3         // A3 A4 A5 A6 被选择的序号


    RowLayout{
        anchors.fill: parent
        spacing: 0
        Rectangle{
           color: pageColor
           Layout.fillWidth : true
           Layout.fillHeight : true

           Rectangle{
               id:imageRec
                width: 320
                height: 450
                color: "white"
                anchors.centerIn: parent
                LayoutMirroring.enabled: true
                LayoutMirroring.childrenInherit: true
                Image {
                    id:showImage
                    mirror: false

                    source:"qrc:/imgs/empty.png"
                    anchors.centerIn: parent

                    Connections{
                        target:printControl
                        onCurPrintFileChanged:{
                            showImage.source = "image://imageprovider/" + printControl.curPrintFile
                        }
                    }
                }
            }
        }

        Rectangle{
            color: pageColor
            radius: 8
            Layout.fillWidth : true
            Layout.fillHeight : true

            ExMessageBox{
                width:350
                height:160

                messageBoxTitle: 'Image Setting'
                anchors.centerIn: parent

                onScaleFunc: {
                    if(showImage.scale > 4) return;
                    showImage.scale *= 1.2
                }

                onRotateFunc: {
                    showImage.rotation += 90
                }

                onOriginFunc: {
                    showImage.scale = 1;
                }

                onMirrorFunc: {
                    //showImage.mirror = !showImage.mirror
                    //console.log("斯蒂芬第三")

                }
            }
        }
    }
}

